package com.test.user

import com.app.web.user.UserAction
import com.test.BaseJerseyServiceTest
import org.glassfish.jersey.server.ResourceConfig
import org.junit.Test
import org.slf4j.Logger
import org.slf4j.LoggerFactory

import javax.ws.rs.client.Entity
import javax.ws.rs.core.Application

/**
 * Created by three on 14-7-29.
 */
class UserActionTest extends BaseJerseyServiceTest {
    private final static Logger logger = LoggerFactory
            .getLogger(UserActionTest.class);

    @Override
    protected Application configure(ResourceConfig rc) {
//        forceSet(TestProperties.CONTAINER_PORT, "0");
        rc.register(UserAction.class)
        return rc;
    }

    @Test
    public void test() {
        def res = target("/user/list").request().get(String.class);
        println(res)

        res = target("/user/list").request().delete();
        println(res.getStatus()+" : " + res.getStatusInfo())

        res = target("/user/list").request().post(Entity.text("okok"));
        println(res)
    }
}
